home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / SCSL / ccfft2d.z / ccfft2d
Encoding:
Text File  |  2002-10-03  |  31.4 KB  |  725 lines

  1.  
  2.  
  3.  
  4. CCCCCCCCFFFFFFFFTTTT2222DDDD((((3333SSSS))))                                                        CCCCCCCCFFFFFFFFTTTT2222DDDD((((3333SSSS))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      CCCCCCCCFFFFFFFFTTTT2222DDDD, ZZZZZZZZFFFFFFFFTTTT2222DDDD - Applies a two-dimensional complex-to-complex Fast
  10.      Fourier Transform (FFT)
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      Single precision complex -> Single precision complex
  14.  
  15.           Fortran:
  16.                CCCCAAAALLLLLLLL CCCCCCCCFFFFFFFFTTTT2222DDDD ((((_i_s_i_g_n,,,, _n_1,,,, _n_2,,,, _s_c_a_l_e,,,, _x,,,, _l_d_x,,,, _y,,,, _l_d_y,,,, _t_a_b_l_e,,,,
  17.                _w_o_r_k,,,, _i_s_y_s))))
  18.  
  19.           C/C++:
  20.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  21.                iiiinnnntttt ccccccccfffffffftttt2222dddd ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n_1,,,, iiiinnnntttt _n_2,,,, ffffllllooooaaaatttt _s_c_a_l_e,,,,
  22.                ssssccccssssllll____ccccoooommmmpppplllleeeexxxx *_x,,,, iiiinnnntttt _l_d_x,,,, ssssccccssssllll____ccccoooommmmpppplllleeeexxxx *_y,,,, iiiinnnntttt _l_d_y,,,, ffffllllooooaaaatttt
  23.                *_t_a_b_l_e,,,, ffffllllooooaaaatttt *_w_o_r_k,,,, iiiinnnntttt *_i_s_y_s))));;;;
  24.  
  25.           C++ STL:
  26.                ####iiiinnnncccclllluuuuddddeeee <<<<ccccoooommmmpppplllleeeexxxx....hhhh>>>>
  27.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  28.                iiiinnnntttt ccccccccfffffffftttt2222dddd ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n_1,,,, iiiinnnntttt _n_2,,,, ffffllllooooaaaatttt _s_c_a_l_e,,,,
  29.                ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>> *_x,,,, iiiinnnntttt _l_d_x,,,, ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>> *_y,,,, iiiinnnntttt _l_d_y,,,, ffffllllooooaaaatttt
  30.                *_t_a_b_l_e,,,, ffffllllooooaaaatttt *_w_o_r_k,,,, iiiinnnntttt *_i_s_y_s))));;;;
  31.  
  32.      Double precision complex -> Double precision complex
  33.  
  34.           Fortran:
  35.                CCCCAAAALLLLLLLL ZZZZZZZZFFFFFFFFTTTT2222DDDD ((((_i_s_i_g_n,,,, _n_1,,,, _n_2,,,, _s_c_a_l_e,,,, _x,,,, _l_d_x,,,, _y,,,, _l_d_y,,,, _t_a_b_l_e,,,,
  36.                _w_o_r_k,,,, _i_s_y_s))))
  37.  
  38.           C/C++:
  39.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  40.                iiiinnnntttt zzzzzzzzfffffffftttt2222dddd ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n_1,,,, iiiinnnntttt _n_2,,,, ddddoooouuuubbbblllleeee _s_c_a_l_e,,,,
  41.                ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx *_x,,,, iiiinnnntttt _l_d_x,,,, ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx *_y,,,, iiiinnnntttt _l_d_y,,,, ddddoooouuuubbbblllleeee
  42.                *_t_a_b_l_e,,,, ddddoooouuuubbbblllleeee *_w_o_r_k,,,, iiiinnnntttt *_i_s_y_s))));;;;
  43.  
  44.           C++ STL:
  45.                ####iiiinnnncccclllluuuuddddeeee <<<<ccccoooommmmpppplllleeeexxxx....hhhh>>>>
  46.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  47.                iiiinnnntttt zzzzzzzzfffffffftttt2222dddd ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n_1,,,, iiiinnnntttt _n_2,,,, ddddoooouuuubbbblllleeee _s_c_a_l_e,,,,
  48.                ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>> *_x,,,, iiiinnnntttt _l_d_x,,,, ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>> *_y,,,, iiiinnnntttt _l_d_y,,,,
  49.                ddddoooouuuubbbblllleeee *_t_a_b_l_e,,,, ddddoooouuuubbbblllleeee *_w_o_r_k,,,, iiiinnnntttt *_i_s_y_s))));;;;
  50.  
  51. IIIIMMMMPPPPLLLLEEEEMMMMEEEENNNNTTTTAAAATTTTIIIIOOOONNNN
  52.      These routines are part of the SCSL Scientific Library and can be loaded
  53.      using either the ----llllssssccccssss or the ----llllssssccccssss____mmmmpppp option.  The ----llllssssccccssss____mmmmpppp option
  54.      directs the linker to use the multi-processor version of the library.
  55.  
  56.      When linking to SCSL with ----llllssssccccssss or ----llllssssccccssss____mmmmpppp, the default integer size is
  57.      4 bytes (32 bits). Another version of SCSL is available in which integers
  58.      are 8 bytes (64 bits).  This version allows the user access to larger
  59.      memory sizes and helps when porting legacy Cray codes.  It can be loaded
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. CCCCCCCCFFFFFFFFTTTT2222DDDD((((3333SSSS))))                                                        CCCCCCCCFFFFFFFFTTTT2222DDDD((((3333SSSS))))
  71.  
  72.  
  73.  
  74.      by using the ----llllssssccccssss____iiii8888 option or the ----llllssssccccssss____iiii8888____mmmmpppp option. A program may use
  75.      only one of the two versions; 4-byte integer and 8-byte integer library
  76.      calls cannot be mixed.
  77.  
  78.      The C and C++ prototypes shown above are appropriate for the 4-byte
  79.      integer version of SCSL. When using the 8-byte integer version, the
  80.      variables of type iiiinnnntttt become lllloooonnnngggg lllloooonnnngggg and the <<<<ssssccccssssllll____fffffffftttt____iiii8888....hhhh>>>> header
  81.      file should be included.
  82.  
  83. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  84.      These routines compute the two-dimensional complex Fast Fourier Transform
  85.      (FFT) of the complex matrix _X, and store the results in the complex
  86.      matrix _Y.
  87.  
  88.      In FFT applications, it is customary to use zero-based subscripts; the
  89.      formulas are simpler that way.  Suppose that the arrays are declared as
  90.      follows:
  91.  
  92.           Fortran:
  93.  
  94.                COMPLEX X(0:ldx-1, 0:n2-1)
  95.                COMPLEX Y(0:ldx-1, 0:n2-1)
  96.  
  97.  
  98.           C/C++:
  99.  
  100.                scsl_complex x[n2][ldx], y[n2][ldy];
  101.  
  102.  
  103.           C++ STL:
  104.  
  105.                complex<float> x[n2][ldx], y[n2][ldy];
  106.  
  107.  
  108.      where _l_d_x >= _n_1, _l_d_y >= _n_1.
  109.  
  110.      These conventions are used in the following equation:
  111.  
  112.           Y(k1,k2) = Yk, k
  113.  
  114.           j1 or j2 = j or j
  115.      These routines compute the formula:
  116.  
  117.                        n1-1  n2-1               (j1 * k1)  (j2 * k2)
  118.      Y(k1,k2) = scale * Sum  Sum [X(j1, j2)*w1      *    w2         ]
  119.                       j1=0  j2=0
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.                                                                         PPPPaaaaggggeeee 2222
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134. CCCCCCCCFFFFFFFFTTTT2222DDDD((((3333SSSS))))                                                        CCCCCCCCFFFFFFFFTTTT2222DDDD((((3333SSSS))))
  135.  
  136.  
  137.  
  138.      for _k_1 = 0 ... _n_1-1
  139.          _k_2 = 0 ... _n_2-1
  140.  
  141.      where:
  142.  
  143.      _w_1        = exp(_i_s_i_g_n*2*_p_i*_i/_n_1)
  144.  
  145.      _w_2        = exp(_i_s_i_g_n*2*_p_i*_i/_n_2)
  146.  
  147.      _i         = + sqrt(-1)
  148.  
  149.      _p_i        = 3.14159...
  150.  
  151.      _i_s_i_g_n     = +1 or -1
  152.  
  153.      Different authors use different conventions for which of the transforms,
  154.      _i_s_i_g_n = +1 or _i_s_i_g_n = -1, is the forward or inverse transform, and what
  155.      the _s_c_a_l_e factor should be in either case.  You can make this routine
  156.      compute any of the various possible definitions, however, by choosing the
  157.      appropriate values for _i_s_i_g_n and _s_c_a_l_e.
  158.  
  159.      The relevant fact from FFT theory is this:  If you take the FFT with any
  160.      particular values of _i_s_i_g_n and _s_c_a_l_e, the mathematical inverse function
  161.      is computed by taking the FFT with -_i_s_i_g_n and 1/(_n_1*_n_2*_s_c_a_l_e).  In
  162.      particular, if you use _i_s_i_g_n = +1 and _s_c_a_l_e = 1.0 for the forward FFT,
  163.      you can compute the inverse FFT by using _i_s_i_g_n = -1 and _s_c_a_l_e =
  164.      1.0/(_n_1*_n_2).
  165.  
  166.      See the NOTES section of this man page for information about the
  167.      interpretation of the data types described in the following arguments.
  168.      These routines have the following arguments:
  169.  
  170.      _i_s_i_g_n     Integer.   (input)
  171.                Specifies whether to initialize the _t_a_b_l_e array or to do the
  172.                forward or inverse transform as follows:
  173.  
  174.                If _i_s_i_g_n = 0, the routine initializes the _t_a_b_l_e array and
  175.                returns.  In this case, the only arguments used or checked are
  176.                _i_s_i_g_n, _n_1, _n_2, _t_a_b_l_e.
  177.  
  178.                If _i_s_i_g_n = +1 or -1, the value of _i_s_i_g_n is the sign of the
  179.                exponent used in the FFT formula.
  180.  
  181.      _n_1        Integer.   (input)
  182.                Transform size in the first dimension.  If _n_1 is not positive,
  183.                the routine returns without performing a transform.
  184.  
  185.      _n_2        Integer.   (input)
  186.                Transform size in the second dimension.  If _n_2 is not positive,
  187.                the routine returns without performing a transform.
  188.  
  189.  
  190.  
  191.  
  192.  
  193.                                                                         PPPPaaaaggggeeee 3333
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200. CCCCCCCCFFFFFFFFTTTT2222DDDD((((3333SSSS))))                                                        CCCCCCCCFFFFFFFFTTTT2222DDDD((((3333SSSS))))
  201.  
  202.  
  203.  
  204.      _s_c_a_l_e     Scale factor. (input)
  205.                CCCCCCCCFFFFFFFFTTTT2222DDDD: Single precision.
  206.                ZZZZZZZZFFFFFFFFTTTT2222DDDD: Double precision.
  207.                Each element of the output array is multiplied by _s_c_a_l_e factor
  208.                after taking the Fourier transform, as defined previously.
  209.  
  210.      _x         Array of dimensions (_l_d_x, _n_2).   (input)
  211.                CCCCCCCCFFFFFFFFTTTT2222DDDD: Complex single precision array.
  212.                ZZZZZZZZFFFFFFFFTTTT2222DDDD: Double precision complex array.
  213.                Input array of values to be transformed.
  214.  
  215.      _l_d_x       Integer.   (input)
  216.                The number of rows in the _x array, as it was declared in the
  217.                calling program (the leading dimension of _x).  _l_d_x >= MMMMAAAAXXXX(_n_1,
  218.                1).
  219.  
  220.      _y         Array of dimension (_l_d_y, _n_2).   (output)
  221.                CCCCCCCCFFFFFFFFTTTT2222DDDD: Single precision complex array.
  222.                ZZZZZZZZFFFFFFFFTTTT2222DDDD: Double precision complex array.
  223.                Output array of transformed values.  The output array may be
  224.                the same as the input array, in which case, the transform is
  225.                done in place (the input array is overwritten with the
  226.                transformed values).  In this case, it is necessary that
  227.                _l_d_x = _l_d_y.
  228.  
  229.      _l_d_y       Integer.   (input)
  230.  
  231.                The number of rows in the _y array, as it was declared in the
  232.                calling program (the leading dimension of _y).  _l_d_y >= MMMMAAAAXXXX(_n_1,
  233.                1).
  234.  
  235.      _t_a_b_l_e     Array of dimension (2*_n_1 + _N_F) + (2*_n_2 + _N_F). (input or output)
  236.                CCCCCCCCFFFFFFFFTTTT2222DDDD: Single precision array.
  237.                ZZZZZZZZFFFFFFFFTTTT2222DDDD: Double precision array.
  238.  
  239.                Table of factors and roots of unity.  See the description of
  240.                the _i_s_y_s argument for the value of _N_F.
  241.  
  242.                If _i_s_i_g_n = 0, the routine initializes _t_a_b_l_e (_t_a_b_l_e is output
  243.                only).
  244.  
  245.                If _i_s_i_g_n = +1 or -1, the values in _t_a_b_l_e are assumed to be
  246.                initialized already by a prior call with _i_s_i_g_n = 0 (_t_a_b_l_e is
  247.                input only).
  248.  
  249.      _w_o_r_k      Array of dimension 2 * MMMMAAAAXXXX((((_n_1,,,, _n_2))))
  250.                CCCCCCCCFFFFFFFFTTTT2222DDDD: Single precision array.
  251.                ZZZZZZZZFFFFFFFFTTTT2222DDDD: Double precision array.
  252.  
  253.                Work array.  This is a scratch array used for intermediate
  254.                calculations.  Its address space must be different from that of
  255.                the input and output arrays.
  256.  
  257.  
  258.  
  259.                                                                         PPPPaaaaggggeeee 4444
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266. CCCCCCCCFFFFFFFFTTTT2222DDDD((((3333SSSS))))                                                        CCCCCCCCFFFFFFFFTTTT2222DDDD((((3333SSSS))))
  267.  
  268.  
  269.  
  270.      _i_s_y_s      Integer array dimensioned 0000........_i_s_y_s((((0000)))).
  271.                An array that gives implementation-specific information.  All
  272.                features and functions of the FFT routines specific to any
  273.                particular implementation are confined to this _i_s_y_s array.
  274.  
  275.                In the Origin series implementation, _i_s_y_s((((0000))))====0000 and _i_s_y_s((((0000))))====1111
  276.                are supported.  In SCSL versions prior to 1.3, only _i_s_y_s((((0000))))====0000
  277.                was allowed. For _i_s_y_s((((0000))))====0000, _N_F====33330000, and for _i_s_y_s((((0000))))====1111, _N_F====222255556666.
  278.                The _N_F words of storage in the _t_a_b_l_e array contain a
  279.                factorization of the length of the transform.
  280.  
  281.                The smaller value of _N_F for _i_s_y_s((((0000))))====0000 is historical. It is too
  282.                small to store all the required factors for the highest
  283.                performing FFT, so when _i_s_y_s((((0000))))====0000, extra space is allocated
  284.                when the _t_a_b_l_e array is initialized. To avoid memory leaks,
  285.                this extra space must be deallocated when the _t_a_b_l_e array is no
  286.                longer needed. The CCCCCCCCFFFFFFFFTTTT2222DDDDFFFF routine is used to release this
  287.                memory. Due to the potential for memory leaks, the use of
  288.                _i_s_y_s((((0000))))====0000 should be avoided.
  289.  
  290.                For _i_s_y_s((((0000))))====1111, the value of _N_F is large enough so that no extra
  291.                memory needs to be allocated, and there is no need to call
  292.                CCCCCCCCFFFFFFFFTTTT2222DDDDFFFF to release memory. If called, it does nothing.
  293.  
  294.                NOTE: _i_s_y_s((((0000))))====1111 means that _i_s_y_s is an integer array with two
  295.                elements. The second element, _i_s_y_s((((1111)))), will not be accessed.
  296.  
  297. NNNNOOOOTTTTEEEESSSS
  298.      The following data types are described in this documentation:
  299.  
  300.           TTTTeeeerrrrmmmm UUUUsssseeeedddd                     DDDDaaaattttaaaa ttttyyyyppppeeee
  301.  
  302.      Fortran:
  303.  
  304.           Array dimensioned 0000........_n----1111      xxxx((((0000::::nnnn----1111))))
  305.  
  306.           Array of dimensions (_m,_n)     xxxx((((mmmm,,,,nnnn))))
  307.  
  308.           Array of dimensions (_m,_n,_p)   xxxx((((mmmm,,,,nnnn,,,,pppp))))
  309.  
  310.           IIIInnnntttteeeeggggeeeerrrr                       IIIINNNNTTTTEEEEGGGGEEEERRRR (IIIINNNNTTTTEEEEGGGGEEEERRRR****8888 for ----llllssssccccssss____iiii8888[[[[____mmmmpppp]]]])
  311.  
  312.           Single precision              RRRREEEEAAAALLLL
  313.  
  314.           Double precision              DDDDOOOOUUUUBBBBLLLLEEEE PPPPRRRREEEECCCCIIIISSSSIIIIOOOONNNN
  315.  
  316.           Single precision complex      CCCCOOOOMMMMPPPPLLLLEEEEXXXX
  317.  
  318.           Double precision complex      DDDDOOOOUUUUBBBBLLLLEEEE CCCCOOOOMMMMPPPPLLLLEEEEXXXX
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.                                                                         PPPPaaaaggggeeee 5555
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332. CCCCCCCCFFFFFFFFTTTT2222DDDD((((3333SSSS))))                                                        CCCCCCCCFFFFFFFFTTTT2222DDDD((((3333SSSS))))
  333.  
  334.  
  335.  
  336.      C/C++:
  337.  
  338.           Array dimensioned 0000........_n----1111      xxxx[[[[_n]]]]
  339.  
  340.           Array of dimensions (_m,_n)     xxxx[[[[mmmm****nnnn]]]] oooorrrr xxxx[[[[nnnn]]]][[[[mmmm]]]]
  341.  
  342.           Array of dimensions (_m,_n,_p)   xxxx[[[[mmmm****nnnn****pppp]]]] oooorrrr xxxx[[[[pppp]]]][[[[nnnn]]]][[[[mmmm]]]]
  343.  
  344.           Integer                       iiiinnnntttt (lllloooonnnngggg lllloooonnnngggg for ----llllssssccccssss____iiii8888[[[[____mmmmpppp]]]])
  345.  
  346.           Single precision              ffffllllooooaaaatttt
  347.  
  348.           Double precision              ddddoooouuuubbbblllleeee
  349.  
  350.           Single precision complex      ssssccccssssllll____ccccoooommmmpppplllleeeexxxx
  351.  
  352.           Double precision complex      ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx
  353.  
  354.      C++ STL:
  355.  
  356.           Array dimensioned 0000........_n----1111      xxxx[[[[_n]]]]
  357.  
  358.           Array of dimensions (_m,_n)     xxxx[[[[mmmm****nnnn]]]] oooorrrr xxxx[[[[nnnn]]]][[[[mmmm]]]]
  359.  
  360.           Array of dimensions (_m,_n,_p)   xxxx[[[[mmmm****nnnn****pppp]]]] oooorrrr xxxx[[[[pppp]]]][[[[nnnn]]]][[[[mmmm]]]]
  361.  
  362.           Integer                       iiiinnnntttt (lllloooonnnngggg lllloooonnnngggg for ----llllssssccccssss____iiii8888[[[[____mmmmpppp]]]])
  363.  
  364.           Single precision              ffffllllooooaaaatttt
  365.  
  366.           Double precision              ddddoooouuuubbbblllleeee
  367.  
  368.           Single precision complex      ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>>
  369.  
  370.           Double precision complex      ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>>
  371.  
  372. CCCCAAAAUUUUTTTTIIIIOOOONNNNSSSS
  373.      Transform sizes with a prime factor exceeding 22223332222----1111 are not supported for
  374.      the 8-byte integer version of the library.
  375.  
  376.      In addition to the _w_o_r_k array, the FFT routines also dynamically allocate
  377.      scratch space from the stack. The amount of space allocated can be
  378.      slightly bigger than the size of the largest processor cache. For single
  379.      processor runs, the default stack size is large enough that these
  380.      allocations generally cause no problems. But for parallel runs, you need
  381.      to ensure that the stack size of slave threads is big enough to hold this
  382.      scratch space. Failure to reserve sufficient stack space will cause
  383.      programs to dump core due to stack overflows.  The stack size of MP
  384.      library slave threads is controlled via the MMMMPPPP____SSSSLLLLAAAAVVVVEEEE____SSSSTTTTAAAACCCCKKKKSSSSIIIIZZZZEEEE
  385.      environment variable or the mmmmpppp____sssseeeetttt____ssssllllaaaavvvveeee____ssssttttaaaacccckkkkssssiiiizzzzeeee(((()))) library routine. See
  386.      the mmmmpppp(3C), mmmmpppp(3F) and ppppeeee____eeeennnnvvvviiiirrrroooonnnn(5) reference pages for more information
  387.      on controlling the slave stack size. For pthreads applications, the
  388.  
  389.  
  390.  
  391.                                                                         PPPPaaaaggggeeee 6666
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398. CCCCCCCCFFFFFFFFTTTT2222DDDD((((3333SSSS))))                                                        CCCCCCCCFFFFFFFFTTTT2222DDDD((((3333SSSS))))
  399.  
  400.  
  401.  
  402.      thread's stack size is specified as one of many creation attributes
  403.      provided in the pthread_attr_t argument to pppptttthhhhrrrreeeeaaaadddd____ccccrrrreeeeaaaatttteeee(3P).  The
  404.      stacksize attribute should be set explicitly to a non-default value using
  405.      the pppptttthhhhrrrreeeeaaaadddd____aaaattttttttrrrr____sssseeeettttssssttttaaaacccckkkkssssiiiizzzzeeee(3P) call, described in the
  406.      pppptttthhhhrrrreeeeaaaadddd____aaaattttttttrrrr____iiiinnnniiiitttt(3P) man page.
  407.  
  408.      Care must be exercised if copies of the _t_a_b_l_e array are used: even though
  409.      a copy exists, the original must persist. As an example, the following
  410.      code will nnnnooootttt work:
  411.  
  412.      #include <scsl_fft.h>
  413.      scsl_complex x[256][129], y[256][129];
  414.      float table[(2*128 + 256) + (2*256 + 256)];
  415.      float work[2*256];
  416.      int isys[2];
  417.      isys[0] = 1;
  418.      {
  419.        float table_orig[(2*128 + 256) + (2*256 + 256)];
  420.  
  421.        ccfft2d(0, 128, 256, 1.0f, (scsl_complex *) x, 129, 129,
  422.              (scsl_complex *) y,  table_orig, work, isys);
  423.        bcopy(table_orig, table, ((2*128+256)+(2*256+256))*sizeof(float));
  424.      }
  425.      ccfft2d(1, 128, 256, 1.0f, (scsl_complex *) x, 129,
  426.              (scsl_complex *) y, 129, table, work, isys);
  427.  
  428.  
  429.      In this example, because _t_a_b_l_e__o_r_i_g is a stack variable that does not
  430.      persist outside of the code block delimited by the braces, the data in
  431.      the copy, _t_a_b_l_e, are not guaranteed to be valid. However, the following
  432.      code will work because _t_a_b_l_e__o_r_i_g is persistent:
  433.  
  434.      #include <scsl_fft.h>
  435.      scsl_complex x[256][129], y[256][129];
  436.      float table_orig[(2*128 + 256) + (2*256 + 256)];
  437.      float table[(2*128 + 256) + (2*256 + 256)];
  438.      float work[2*256];
  439.      int isys[2];
  440.      isys[0] = 1;
  441.      ccfft2d(0, 128, 256, 1.0f, (scsl_complex *) x, 129,
  442.             (scsl_complex *) y, 129, table_orig, work, isys);
  443.      bcopy(table_orig, table, ((2*128+256)+(2*256+256))*sizeof(float));
  444.      ccfft2d(1, 128, 256, 1.0f, (scsl_complex *) x, 129,
  445.              (scsl_complex *) y, 129, table, work, isys);
  446.  
  447.  
  448. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  449.      All examples here are for Origin series only.
  450.  
  451.      Example 1:  Initialize the TTTTAAAABBBBLLLLEEEE array in preparation for doing a two-
  452.      dimensional FFT of size 128 by 256.  In this case only the _i_s_i_g_n, _n_1, _n_2,
  453.      and _t_a_b_l_e arguments are used; you can use dummy arguments or zeros for
  454.  
  455.  
  456.  
  457.                                                                         PPPPaaaaggggeeee 7777
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464. CCCCCCCCFFFFFFFFTTTT2222DDDD((((3333SSSS))))                                                        CCCCCCCCFFFFFFFFTTTT2222DDDD((((3333SSSS))))
  465.  
  466.  
  467.  
  468.      other arguments.
  469.  
  470.      Fortran:
  471.  
  472.            REAL TABLE ((2*128 + 256) + (2*256 + 256))
  473.            INTEGER ISYS(0:1)
  474.            ISYS(0) = 1
  475.            CALL CCFFT2D (0, 128, 256, 0.0, DUMMY, 1, DUMMY, 1,
  476.           &              TABLE, DUMMY, ISYS)
  477.  
  478.  
  479.      C/C++:
  480.  
  481.      #include <scsl_fft.h>
  482.      float table[(2*128 + 256) + (2*256 + 256)];
  483.      int isys[2];
  484.      isys[0] = 1;
  485.      ccfft2d(0, 128, 256, 0.0f, NULL, 1, NULL, 1, table, NULL, isys);
  486.  
  487.  
  488.      C++ STL:
  489.  
  490.      #include <complex.h>
  491.      #include <scsl_fft.h>
  492.      float table[(2*128 + 256) + (2*256 + 256)];
  493.      int isys[2];
  494.      isys[0] = 1;
  495.      ccfft2d(0, 128, 256, 0.0f, NULL, 1, NULL, 1, table, NULL, isys);
  496.  
  497.  
  498.      Example 2:  _X and _Y are complex arrays dimensioned (0..128, 0..255).  The
  499.      first 128 elements of each column contain data.  For performance reasons,
  500.      the extra element forces the leading dimension to be an odd number.  Take
  501.      the two-dimensional FFT of _X and store it in _Y.  Initialize the _t_a_b_l_e
  502.      array, as in example 1.
  503.  
  504.      Fortran:
  505.  
  506.            COMPLEX X(0:128, 0:255)
  507.            COMPLEX Y(0:128, 0:255)
  508.            REAL TABLE((2*128 + 256) + (2*256 + 256))
  509.            REAL WORK 2*MAX(128,256)
  510.            INTEGER ISYS(0:1)
  511.            ISYS(0) = 1
  512.            CALL CCFFT2D(0, 128, 256, 1.0, X, 129, Y, 129,
  513.           &             TABLE, WORK, ISYS)
  514.            CALL CCFFT2D(1, 128, 256, 1.0, X, 129, Y, 129,
  515.           &             TABLE, WORK, ISYS)
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.                                                                         PPPPaaaaggggeeee 8888
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530. CCCCCCCCFFFFFFFFTTTT2222DDDD((((3333SSSS))))                                                        CCCCCCCCFFFFFFFFTTTT2222DDDD((((3333SSSS))))
  531.  
  532.  
  533.  
  534.      C/C++:
  535.  
  536.           #include <scsl_fft.h>
  537.           scsl_complex x[256][129], y[256][129];
  538.           float table[(2*128 + 256) + (2*256 + 256)];
  539.           float work[2*256];
  540.           int isys[2];
  541.           isys[0] = 1;
  542.           ccfft2d(0, 128, 256, 1.0f, (scsl_complex *) x, 129,
  543.                  (scsl_complex *) y, 129, table, work, isys);
  544.           ccfft2d(1, 128, 256, 1.0f, (scsl_complex *) x, 129,
  545.                  (scsl_complex *) y, 129, table, work, isys);
  546.  
  547.  
  548.      C++ STL:
  549.  
  550.           #include <complex.h>
  551.           #include <scsl_fft.h>
  552.           complex<float> x[256][129], y[256][129];
  553.           float table[(2*128 + 256) + (2*256 + 256)];
  554.           float work[2*256];
  555.           int isys[2];
  556.           isys[0] = 1;
  557.           ccfft2d(0, 128, 256, 1.0f, (complex<float> *) x, 129,
  558.                  (complex<float> *) y, 129, table, work, isys);
  559.           ccfft2d(1, 128, 256, 1.0f, (complex<float> *) x, 129,
  560.                  (complex<float> *) y, 129, table, work, isys);
  561.  
  562.  
  563.      Example 3:  With _X and _Y as in example 2, take the inverse FFT of _Y and
  564.      store it back in _X.  The scale factor 1/(128*256) is used.  Assume that
  565.      the _t_a_b_l_e array is already initialized.
  566.  
  567.      Fortran:
  568.  
  569.            CALL CCFFT2D(-1, 128, 256, 1.0/(128.0*256.0), Y, 129,
  570.           &             X, 129, TABLE, WORK, ISYS)
  571.  
  572.  
  573.      C/C++:
  574.  
  575.      ccfft2d(-1, 128, 256, 1.0f/(128.0f*256.0f), (scsl_complex *) y,
  576.              129, (scsl_complex *) x, 129, table, work, isys);
  577.  
  578.  
  579.      C++ STL:
  580.  
  581.      ccfft2d(-1, 128, 256, 1.0f/(128.0f*256.0f), (complex<float> *) y,
  582.             129, (complex<float> *) x, 129, table, work, isys);
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.                                                                         PPPPaaaaggggeeee 9999
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596. CCCCCCCCFFFFFFFFTTTT2222DDDD((((3333SSSS))))                                                        CCCCCCCCFFFFFFFFTTTT2222DDDD((((3333SSSS))))
  597.  
  598.  
  599.  
  600.      Example 4:  Perform the same computation as in example 2, but put the
  601.      output back in array _X to save storage space.  Use the 8-byte integer
  602.      version of SCSL.
  603.  
  604.      Fortran:
  605.  
  606.            COMPLEX X(0:128, 0:255)
  607.            REAL TABLE((2*128 + 256) + (2*256 + 256))
  608.            REAL WORK(2*256)
  609.            INTEGER*8 ISYS(0:1)
  610.            ISYS(0) = 1_8
  611.            CALL CCFFT2D(0_8, 128_8, 256_8, 1.0, X, 129_8, X, 129_8,
  612.           &             TABLE, WORK, ISYS)
  613.            CALL CCFFT2D(1_8, 128_8, 256_8, 1.0, X, 129_8, X, 129_8,
  614.           &             TABLE, WORK, ISYS)
  615.  
  616.  
  617.      C/C++:
  618.  
  619.      #include <scsl_fft_i8.h>
  620.      scsl_complex x[256][129];
  621.      float table[(2*128 + 256) + (2*256 + 256)];
  622.      float work[2*256];
  623.      long long isys[2];
  624.      isys[0] = 1LL;
  625.      ccfft2d(0LL, 128LL, 256LL, 1.0f, (scsl_complex *) x, 129LL,
  626.             (scsl_complex *) x, 129LL, table, work, isys);
  627.  
  628.  
  629.      C++ STL:
  630.  
  631.      #include <complex.h>
  632.      #include <scsl_fft_i8.h>
  633.      complex<float> x[256][129];
  634.      float table[(2*128 + 256) + (2*256 + 256)];
  635.      float work[2*256];
  636.      long long isys[2];
  637.      isys[0] = 1LL;
  638.      ccfft2d(0LL, 128LL, 256LL, 1.0f, (complex<float> *) x, 129LL,
  639.              (complex<float> *) x, 129LL, table, work, isys);
  640.  
  641.  
  642.      Example 5:  Perform the same computation as in example 2, but assume that
  643.      the lower bound of each Fortran array is 1, rather than 0.  The
  644.      subroutine calls are not changed.
  645.  
  646.      Fortran:
  647.  
  648.      COMPLEX X(129, 256)
  649.      COMPLEX Y(129, 256)
  650.      CALL CCFFT2D(0, 128, 256, 1.0, X, 129, Y, 129, TABLE, WORK, 0)
  651.      CALL CCFFT2D(1, 128, 256, 1.0, X, 129, Y, 129, TABLE, WORK, 0)
  652.  
  653.  
  654.  
  655.                                                                        PPPPaaaaggggeeee 11110000
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662. CCCCCCCCFFFFFFFFTTTT2222DDDD((((3333SSSS))))                                                        CCCCCCCCFFFFFFFFTTTT2222DDDD((((3333SSSS))))
  663.  
  664.  
  665.  
  666. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  667.      IIIINNNNTTTTRRRROOOO____SSSSCCCCSSSSLLLL(3S), IIIINNNNTTTTRRRROOOO____FFFFFFFFTTTT(3S), CCCCCCCCFFFFFFFFTTTT(3S), CCCCCCCCFFFFFFFFTTTT3333DDDD(3S), CCCCCCCCFFFFFFFFTTTTMMMM(3S),
  668.      SSSSCCCCFFFFFFFFTTTT(3S), SSSSCCCCFFFFFFFFTTTT2222DDDD(3S), SSSSCCCCFFFFFFFFTTTT3333DDDD(3S), SSSSCCCCFFFFFFFFTTTTMMMM(3S)
  669.  
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.                                                                        PPPPaaaaggggeeee 11111111
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.